<template>
		<view class="__svg" :class="{'action': !show}" id="__svg-gold" :style="{width: size + 'px',height: size + 'px'}"></view>
</template>

<script>
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			size: {
				type: String,
				default: 28
			},
		},
		data() {
			return {
				is_show: false
			}
		},
		methods: {

		}
	}
</script>
<script module="svgs" lang="renderjs">
	export default {
		mounted() {
			if (typeof window.svgs === 'function') {
				this.initSvgs()
			} else {
				// 动态引入较大类库避免影响页面展示
				const script = document.createElement('script')
				// view 层的页面运行在 www 根目录，其相对路径相对于 www 计算
				script.src = 'static/svg.js'
				script.onload = this.initsvg.bind(this)
				document.head.appendChild(script)
			}
		},
		methods: {
			initsvg: function(e) {
				var svg = SVG().addTo('#__svg-gold');
				svg.attr({
					viewBox: '0 0 1024 1024',
				});
				svg.path(
					'M511.45 1002.55c-65.71 0-129.48-12.88-189.54-38.28-57.98-24.53-110.05-59.63-154.76-104.33-44.7-44.7-79.81-96.77-104.33-154.76-25.4-60.05-38.28-123.82-38.28-189.54S37.42 386.16 62.82 326.1c24.53-57.98 59.63-110.05 104.33-154.76 44.7-44.7 96.77-79.81 154.76-104.33 60.05-25.4 123.82-38.28 189.54-38.28s129.48 12.88 189.54 38.28c57.98 24.53 110.05 59.63 154.76 104.33 44.7 44.7 79.81 96.77 104.33 154.76 25.4 60.05 38.28 123.82 38.28 189.54s-12.88 129.48-38.28 189.54c-24.53 57.99-59.63 110.05-104.33 154.76s-96.77 79.81-154.76 104.33c-60.06 25.4-123.82 38.28-189.54 38.28z m0-897.81c-55.49 0-109.3 10.86-159.93 32.28-48.93 20.69-92.87 50.33-130.62 88.08s-67.38 81.7-88.08 130.62c-21.42 50.63-32.28 104.44-32.28 159.93s10.86 109.3 32.28 159.93c20.69 48.92 50.33 92.87 88.08 130.62s81.7 67.38 130.62 88.08c50.63 21.42 104.44 32.28 159.93 32.28s109.3-10.86 159.93-32.28c48.93-20.69 92.87-50.33 130.62-88.08s67.38-81.7 88.08-130.62c21.42-50.63 32.28-104.44 32.28-159.93s-10.86-109.3-32.28-159.93c-20.69-48.93-50.33-92.87-88.08-130.62s-81.7-67.38-130.62-88.08c-50.63-21.42-104.44-32.28-159.93-32.28z'
					).attr({
					class: 'gold',
					
				});
				svg.path(
					'M489.27 386.92c-14.84 14.84-38.9 14.84-53.74 0l-89.44-89.44c-14.84-14.84-14.84-38.9 0-53.74 14.84-14.84 38.9-14.84 53.74 0l89.44 89.44c14.84 14.84 14.84 38.9 0 53.74z'
					).attr({
					class: 'gold1'
				});
				svg.path(
					'M514.32 801.76c-20.99 0-38-17.01-38-38V397.22c0-20.99 17.01-38 38-38s38 17.01 38 38v366.53c0 20.99-17.01 38.01-38 38.01z'
					).attr({
					class: 'gold2'
				})
				svg.path(
					'M660.18 460.47c0 20.99-17.01 38-38 38H402.1c-20.99 0-38-17.01-38-38s17.01-38 38-38h220.08c20.99 0 38 17.01 38 38zM537.69 386.67c14.84 14.84 38.9 14.84 53.74 0l89.44-89.44c14.84-14.84 14.84-38.9 0-53.74-14.84-14.84-38.9-14.84-53.74 0l-89.44 89.44c-14.84 14.84-14.84 38.9 0 53.74zM659.49 576.05c0 20.99-17.01 38-38 38H401.41c-20.99 0-38-17.01-38-38s17.01-38 38-38h220.08c20.99 0 38 17.01 38 38z'
					).attr({
					class: 'gold3'
				})

			},
		}
	}
</script>

<style>
	
</style>
